package operation.impl;

import book.Book;
import book.BookList;
import operation.IOperation;

/**
 * 显示图书
 */
public class ShowOperation implements IOperation {

    @Override
    public void work(BookList bookList) {
        System.out.println("显示图书");
        for (int i = 0; i < bookList.getUsedSize(); i++) {
            Book book = bookList.getBook(i);

            //删除只是将图书置空，所以在显示图书的时候需要判断一下，
            // 图书是否为空，不为空，再打印
            if(book != null){
                System.out.println(book);
            }
        }
    }
}
